<template>
    <!-- 返回导航栏 -->
  <div class="back-nav">
    <van-nav-bar
    :title="title"
    :left-text="leftText"
    :right-text="rightText"
    :left-arrow="leftArrow"
    @click-left="back"
    @click-right="edit"
    />
  </div>
</template>

<script>
export default {
    name:'BackNav',
    props: {
        title: {
            type:String,
            default:''
        },
        leftArrow: {
            type:Boolean,
            default:false
        },
        leftText: {
            type:String,
            default:''
        },
        rightText: {
            type:String,
            default:''
        }
    },
    data() {
        return {
            flag:false,
        }
    },
    methods: {
        back() {
            this.$router.go(-1);
        },
        edit() {
            this.flag=!this.flag;
            // 
            this.$emit('shop-edit',this.flag );
        },
        
    }
}
</script>

<style lang='less' scoped>
@import url('../../assets/css/base.less');

 //给框架元素修改样式加 /deep/
    .back-nav{
        /deep/ .van-nav-bar .van-icon{
        background-color: @mainColor;
        }

        /deep/ .van-nav-bar__text{
        color: #fff;
        }
    }
</style>